/**
 * @Author lizeyu
 * @Date 2020/4/7 9:38
 */
public class single_test {
    public static void main(String[] args) {
        Vehicle car = new Vehicle("汽车");
        car.run(car.getname());
        Vehicle airPlane = new Vehicle("飞机");
        airPlane.run(airPlane.getname());
        Vehicle ship = new Vehicle("轮船");
        ship.run(ship.getname());
    }
}

class Vehicle{
    private String name;

    public Vehicle(String name) {
        this.name = name;
    }

    public String getname() {
        return name;
    }

    public void setname(String name) {
        this.name = name;
    }

    public void run(String name) {
        System.out.println(name+"交通工具是在陆地上运行");
    }
}
